import javax.naming.InitialContext;
import javax.swing.*;
import java.awt.*;

public class MainFrame {
    public static void main(String[] args){
        JFrame Mainframe = new JFrame();
        Init(Mainframe);
    }
    public static void Init(JFrame frame){
        //窗口大小
        frame.setSize(1600,1000);
        frame.setTitle("Domino");
        //居中
        frame.setLocationRelativeTo(null);
        frame.setLayout(null);
        //关闭时关闭java虚拟机
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        //所有骨牌实例初始化
        DominoManager.Instance.Init();
        //游戏区域
        GamePanel.Instance.Init();
        frame.add(GamePanel.Instance);
        //我方牌堆
        // MyLibrary.Instance.Init();
        // frame.add(MyLibrary.Instance);
        MyScrollLibrary.Instance.Init();
        frame.add(MyScrollLibrary.Instance);
        //相关按钮
        TurnManager.Instance.Init();
        frame.add(TurnManager.Instance.Pass);
        frame.add(TurnManager.Instance.PlayACard);
        frame.add(TurnManager.Instance.PlatACardToTail);
        //窗口可见
        frame.setVisible(true);
        DominoManager.Instance.Init();
    }
}
